home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / creator.arc / ADVDOC.DOC < prev    next >
Encoding:
Text File  |  1985-08-27  |  31.7 KB  |  816 lines

  1. ADVENTURE COMPILER/INTERPRETER
  2. ----------------------------------------------
  3.  
  4. Basic Version
  5.  
  6.  
  7. Peter F. Levy
  8. 4209 Longmeadow Way
  9. Fort Worth, TX 76133
  10.  
  11. (817) 292-8731
  12.  
  13. INTRODUCTION to version 
  14.  
  15. This DOCUMENTATION file is for the trash-80 version.  As far as
  16. I know, the IBM-PC version on this BBS works, but there is no
  17. guarantee that this doc file will match.  This is a pretty serious
  18. little program, and I hope all these features work.
  19. --MIke Stone
  20.  
  21. Adventure game scenarios are created or edited using any text 
  22. editor.  ASCII data files are compiled by utility COMPILER.BAS in 
  23. order to prepare them for interpretation by DRIVER.BAS.  The 
  24. third program in this system, DISASSEM.BAS, (not for PC yet)
  25. is used to disassemble compiled adventures into an editable, 
  26. re-compilable source file.
  27.  
  28. For simplicity's sake, COMPILER.BAS will be referred to as 
  29. "the compiler", DRIVER.BAS as "the driver", and DISASSEM.BAS 
  30. as "the disassembler".
  31.  
  32. In order to allow this system to interpret very large 
  33. databases, the driver does not maintain an entire adventure in
  34. memory.  Instead, the parts of the database which require 
  35. frequent or immediate access are stored in memory, while the 
  36. remainder are kept on disk in an indexed reference file.  The 
  37. index permits almost instant access to random data.
  38.  
  39. There are consequently a total of four separate disk files 
  40. associated with each complete adventure.  For any one 
  41. adventure, each has the same file name (the name of the 
  42. adventure) but a different identifying suffix.  The name of 
  43. the adventure is defined by the filespec under which the 
  44. creator saves the ASCII source file.  These files are:
  45.  
  46.   (1) name/ADV, the ASCII source file
  47.   (2) name/DAT, the portion of the database which resides in
  48.       memory while the adventure is played
  49.   (3) name/REF, the reference file addressed by the driver on
  50.       an as-needed basis
  51.   (4) name/NDX, the index to the reference file.
  52.  
  53.  
  54. The source file is used only by the compiler and need not be 
  55. present to play a compiled adventure.  The other three files 
  56. (which are created by the compiler) must be present for the 
  57. adventure to be played.
  58.  
  59.  
  60. The remainder of these instructions will consist of sections 
  61. explaining the use of the compiler, driver, and disassembler; 
  62. followed by a detailed explanation of the source database 
  63. structure.
  64.  
  65.  
  66.  
  67. DEFINITION OF TERMS
  68.  
  69. VERB:    the first operative word of a player input, usually
  70.          specifying what is to be done.
  71. NOUN:    the second operative word of a player input, usually
  72.          specifying what the action is to be done to.
  73. OBJECT:  (a) the third operative word of a player input,
  74.              usually specifying the tool through which the
  75.              verb will be applied to the noun.
  76.          (b) an item in the game having the properties of
  77.              description, location, and weight
  78. ROOM:    a discrete location in the game play area
  79. MESSAGE: a predefined text displayable as a response to
  80.          player input
  81. IMPLICIT ACTION:  a series of tests and/or actions
  82.          carried out by the driver each iteration of play
  83.          without player interaction.  Each implicit action is
  84.          attempted each iteration of play.
  85. EXPLICIT ACTION:  a series of tests and/or actions to be
  86.          carried out by the driver in response to a specific
  87.          player input or command.  An explicit action is
  88.          attempted only in response to player input for which
  89.          it is defined.
  90. TOKEN:  a mnemonic word used to name a specific test or action
  91.  
  92.  
  93.  
  94. THE COMPILER
  95.  
  96. The compiler creates the files required to actually play the 
  97. adventure, based on the information contained in the ASCII 
  98. source file.  The LADS compiler is called COMPIL.BAS.  It 
  99. requires four file areas to run (they need not be declared V 
  100. filareas, though).
  101.  
  102. You will first be asked "Database name? ".  Reply with the 
  103. name of the adventure database to be compiled (excluding the 
  104.  
  105. Next you are asked, "Compilation drive? (1-3)".  Reply with 
  106. the number of the disk drive (1-3) which is to receive the 
  107. compiled adventure files.  The source file need not be 
  108. resident on that particular drive.
  109.  
  110. Last, you are asked "Hard copy of compilation messages? 
  111. (Y/N)".  Reply Y if the messages the compiler displayed during
  112. its run (including error warnings and diagnostics) are to be 
  113. sent to the system printer as well as screen.
  114.  
  115. The compiler runs to completion without user interaction.  As 
  116. the compilation progresses, messages will be displayed naming 
  117. the part of the database currently being processed and 
  118. describing any errors encountered; followed by "Compilation 
  119. complete" and a return to READY.  The adventure may be played 
  120. immediately after compilation has been completed.
  121.  
  122. Compilation error messages are detailed and, hopefully, 
  123. self-explanatory.
  124.  
  125.  
  126.  
  127. THE DISASSEMBLER
  128.  
  129. The disassembler can read a set of compiled adventure data 
  130. files and generate source listings.  The disassembler has the 
  131. ability to provide hard copy and a disk source file, which can
  132. be edited if desired and re-compiled by COMPILER.BAS.  All 
  133. three of an adventure's runtime files (name/DAT, name/REF, and
  134. name/NDX) must be present for the disassembler to work.
  135.  
  136. The disassembler requires four file areas to run.  They do not
  137. need to be V type.
  138.  
  139. When you run the disassembler, you are first asked "Database
  140. name?".  Reply with the name of the adventure to be 
  141. disassembled, excluding any extensions.
  142.  
  143. Next you are asked "Disassembly to line printer? (Y/N)".  
  144. Reply Y or N, depending on whether or not you want a hard copy
  145. of the disassembled source file.
  146.  
  147. Next you are asked "Create source file on disk? (Y/N)".  Reply
  148. Y or N, depending on whether or not you want to create an 
  149. ASCII source file on disk.  If you reply Y, you will be 
  150. further prompted "Destination file? (full filespec)".  Reply 
  151. with the full name (including any extensions and drive 
  152. specifications) of the file to receive the created source 
  153. text.
  154.  
  155. The disassembler runs to completion without user interaction.
  156.  
  157.  
  158.  
  159. THE INTERPRETER
  160.  
  161. The interpreter is the game executor and moderator.  It 
  162. supervises play of the game, updating the situation in 
  163. response to the player's typed commands and displaying the 
  164. game situation for the player.  The LADS driver is called 
  165. DRIVER.BAS.  It requires three file areas to run, which do not
  166. need to be V type.
  167.  
  168. The driver will ask, "Adventure name?".  Reply with the name 
  169. of the adventure to be played, excluding any extensions.
  170.  
  171. The driver will open the needed files and almost immediately 
  172. display an opening text, which will remain displayed while the
  173. reference and index files are opened and the data file is 
  174. transferred into memory.  When this setup phase is complete, 
  175. "(press space bar to begin play)" will appear at the bottom 
  176. center of the screen.  Play of the adventure will begin when 
  177. the space bar is depressed.
  178.  
  179. Play of adventures under this system consists of a fairly 
  180. simple loop of events:  (a) the driver displays the current 
  181. situation and a ">" prompt, (b) the player types his responses
  182. in any reasonable grammatical form, and (c) the driver 
  183. interprets the player's response and updates the game 
  184. situation accordingly.
  185.  
  186. NOTE:  The Basic version of LADS does not perform lower-upper 
  187. case conversion.  All input must be upper case.
  188.  
  189.  
  190. Although the command parser (which translates typed input into
  191. numbers understandable by the driver) does a good job of 
  192. extracting information from fairly complex input phrases, it 
  193. does assume that the content of the player's response conforms
  194. generally to a "verb-noun-object" structure, i.e., something 
  195. along the general lines of "verb the noun with the object".
  196.  
  197. The player may interrupt the game and return to READY 
  198. immediately by pressing BREAK at any time.  This exit will not
  199. close the data files, but this is harmless since the driver 
  200. never writes to disk.
  201.  
  202. This system has eight abbreviated single-letter commands:  N, 
  203. S, E, W, U, D, I, and L.  N, S, E, W, U, and D are exactly 
  204. equivalent to "GO NORTH", "GO SOUTH", etc.  I displays an 
  205. inventory of what the player is currently carrying.  L stands 
  206. for "look" and describes the player's current location, and 
  207. any objects present, in detail.
  208.  
  209. The driver uses the bottom lines of the screen for a situation
  210. summary, which is updated each time the player enters any 
  211. command.  The upper line of this summary shows the player's 
  212. current location; the lower line shows available exits, the 
  213. player's load (in percent of his carrying capacity), his 
  214. current score, and the number of game turns played so far.
  215.  
  216.  
  217. CREATING AN ADVENTURE -- SOURCE FILE STRUCTURE
  218.  
  219. An adventure source file in LADS is a straight ASCII text 
  220. file.  Each source file contains nine SECTIONS, each of which 
  221. is segmented into RECORDS.  The end of each record is marked 
  222. by a carriage return and the end of each section by two 
  223. consecutive carriage returns.  The nine sections are (in the 
  224. order in which they must exist within the file):
  225.  
  226.  
  227.      1.  a header record
  228.      2.  a verb dictionary
  229.      3.  a noun dictionary
  230.      4.  an object list
  231.      5.  a room list
  232.      6.  a message list
  233.      7.  an implicit action table
  234.      8.  an explicit action table
  235.      9.  a remarks section, not read by the compiler.
  236.  
  237. NOTE:  In order to allow the adventure creator to display 
  238. several texts on one line, this system does NOT automatically 
  239. add a carriage return to the end of any text.  It is the 
  240. writer's responsibility to include a linefeed symbol ("/") at 
  241. the end of a text if desired.
  242.  
  243.  
  244.  
  245. HEADER
  246.  
  247. The first section is the HEADER, which is simply the 
  248. introductory or instructive text which the driver is to 
  249. display during setup.  Any slashes ("/") in this text will be 
  250. compiled as linefeeds; all other characters are displayed 
  251. exactly as entered.  Single carriage returns are also allowed 
  252. within the header record.  There is no limit to the length of 
  253. the header, but if it is longer than about 700 characters it 
  254. is likely to scroll the display.  The end of this header 
  255. section is marked by two consecutive carriage returns.
  256.  
  257.  
  258.  
  259. VERB SECTION
  260.  
  261. The second section is the verb dictionary.  This is a list of 
  262. all words which are to be used as verbs in the play of this 
  263. adventure.  Each record in this section consists of a verb 
  264. followed by a comma or a carriage return.  There should be no 
  265. spaces between words and separators, and all words should be 
  266. in upper case.  The section is ended with a double carriage 
  267. return.
  268.  
  269. You may specify up to 99 verbs.
  270.  
  271. The first three verbs must be "GET", "DROP", and "GO", in that
  272. order.
  273.  
  274. EXAMPLE:
  275.  
  276. GET<CR>
  277. DROP<CR>
  278. GO<CR>
  279. ATTACK<CR>
  280. WAIT<CR><CR>
  281.  
  282.  
  283.  
  284. NOUN SECTION
  285.  
  286. The third section is the noun dictionary.  This is structured
  287. similarly to the verb dictionary, with two differences.
  288.  
  289. First, there are seven required nouns:  the first through 
  290. seventh nouns must be "ANY", "NORTH", "SOUTH", "EAST", "WEST",
  291. "UP", and "DOWN" (in that order).
  292.  
  293. Second, following each noun is an "object link", which is a 
  294. number from 0 to 255.  This specifies the object, by number, 
  295. to which the noun refers.  If the noun will not be used to 
  296. refer to any specific object, its link should be 0.  A noun 
  297. must be linked to a (material) object in the object list for 
  298. it to function when used as a (grammatical) object in player 
  299. input during game play.
  300.  
  301. You may specify up to 99 nouns.
  302.  
  303. EXAMPLE:
  304.  
  305. ANY<CR>
  306. .
  307. .
  308. BOOK,2<CR>
  309. NEWSPAPER,6<CR>
  310. DISKETTE,0<CR><CR>
  311.  
  312.  
  313.  
  314. OBJECT SECTION
  315.  
  316. The fourth section is the object table.  The object table 
  317. contains up to 255 records, each of which describes one object
  318. in the game.  Each record has six items in it:
  319.  
  320. (a) An object number from 1 to 255, followed by a space.  
  321.     These numbers are the ones to which the noun links refer.
  322.     Object numbers must be assigned sequentially starting from
  323.     1.
  324.  
  325. (b) The object's name, which must be no longer than 50 
  326.     characters and is ended by a comma.  Both upper and lower
  327.     case characters are permitted, as well as digits, spaces,
  328.     and punctuation (except a comma, of course.)
  329.  
  330. (c) The object's start room, which is a number which describes
  331.     the object's location at the start of the game.  LADS uses
  332.     rooms numbered from 0 to 255.  An object may be placed in
  333.     any room.  Room 0 is a storeroom of objects not in play
  334.     for now, room 255 is the location of objects carried by
  335.     the player.
  336.  
  337. (d) The object's weight, in percent of the player's carrying 
  338.     capacity.  A weight of 255 signifies an immovable object.
  339.  
  340. (e) The object's point value.  This is the number of points 
  341.     the player is awarded for carrying the object.
  342.  
  343. (f) The object's long description, which may be up to 255 
  344.     characters long and contain any characters.  Slashes will
  345.     be compiled as linefeeds. The long description (and the
  346.     record) are terminated by a carriage return.
  347.  
  348. The object's name is how it is referred to when the inventory 
  349. ("I") command is issued; its long description is the notice 
  350. printed by the driver to announce object's presence.
  351.  
  352. EXAMPLE:
  353.  
  354. 1 Book,1,5,0,There is an old leather-bound book here./<CR>
  355. 2 Brass lantern,0,15,20,You note a shiny brass lantern lying/
  356. nearby./<CR>
  357. 3 Statue,3,255,0,There is a six foot high statue of a/  
  358. parakeet in the room./<CR>
  359. 4 Stairs,7,255,0,A flight of narrow stairs leads up./<CR><CR>
  360.  
  361. Note that linefeed symbols ("/") are added to the end of each 
  362. text line.  If this is omitted, the next line of text the 
  363. driver displays will follow the previous line without any 
  364. linefeeds.
  365.  
  366.  
  367.  
  368. ROOM SECTION
  369.  
  370. The fifth section is the room table.  This section is very 
  371. similar to the object table.  It consists of a start room 
  372. number (1 to whatever) followed by up to up to 255 records, 
  373. each of which describes one room (or discrete location).  Each
  374. record has the following structure:
  375.  
  376. (a) A room number from 1 to 254, followed by a blank.  No two
  377.     rooms may have the same number.  Note that rooms 0 and 255
  378.     are predefined:  room 0 is a storeroom for objects not
  379.     currently in play; room 255 is the player (objects that
  380.     are carried are in room 255).  Rooms 0 and 255 MUST NOT be
  381.     defined in the room table.  Room  numbers must be assigned
  382.     sequentially starting from 1.
  383.  
  384. (b) A room name, up to 50 characters long, ended by a comma.
  385.     Any other characters are allowed.
  386.  
  387. (c) Six links, specifying (by number) the connecting rooms to
  388.     the north, south, east, west, up, and down; respectively.
  389.     Zero indicates no passage in a particular direction.
  390.  
  391. (d) A long description of the room, ended by a carriage
  392.     return.  The description may be any length.  Slashes in
  393.     this description are compiled as linefeeds.
  394.  
  395.  
  396. ROOM CONNECTION DETAILS.  The room connections specified by 
  397. the links in the room table are a room's "obvious exits", and 
  398. will be dislayed as available exits on the status dislay at 
  399. the bottom of the screen.  Any other room connections are not 
  400. "obvious" and won't be displayed; the player must be told of 
  401. them.
  402.  
  403.  
  404. EXAMPLE:  (the first line is the start room number, the number
  405. of the room the game starts with the player in)
  406.  
  407. 13
  408. 1 Cave,0,3,0,6,0,5,You are in a large cavern./<CR>
  409. 2 Computer room,1,5,0,0,0,0,You are in a computer room.  A /
  410. TRS-80 named Minerva awaits your bidding./<CR><CR>
  411.  
  412.  
  413.  
  414. MESSAGE SECTION
  415.  
  416. Each record in the message table defines one message available
  417. to the adventure driver, and contains two items:  a message 
  418. number from 1 to 255, followed by a space; and the message 
  419. text terminated with a carriage return.  The text may be up to
  420. 255 characters long and may contain any characters.  Slashes 
  421. are compiled as linefeeds.  Message  numbers must be assigned 
  422. sequentially starting from 1.
  423.  
  424.  
  425. EXAMPLE:
  426.  
  427. 1 The UFO's protective field won't let you approach./<CR>
  428. 2 Please don't shoot him, you'll only make him mad./<CR>
  429. 3 There was a passage hidden behind the drapes!/<CR><CR>
  430.  
  431.  
  432.  
  433. IMPLICIT ACTION TABLE
  434.  
  435. The seventh section describes the background activities to 
  436. take place during play of an adventure.  Implicit actions are 
  437. attempted automatically by the driver each turn of play, and 
  438. are used to move dragons around at random, check to see if 
  439. certain unsupervised (uncommanded, therefore implicit) actions
  440. are to take place, and so on.  Each activity consists of a 
  441. line naming tests and actions to be carried out by the driver 
  442. and is ended by a space-period-carriage return sequence.  The 
  443. exact structure of an action line, and the names and uses of 
  444. the different tests and actions available, are explained in a 
  445. later section.  The table is terminated with a double carriage
  446. return.
  447.  
  448. Action entries may be divided over several lines.  If a line 
  449. ends with a space-comma-carriage return, the next line is 
  450. treated as a continuation of the same action line.
  451.  
  452.  
  453.  
  454. EXPLICIT ACTION TABLE
  455.  
  456. The eighth section is the explicit action table.  An explicit 
  457. action is carried out by the driver in response to a specific 
  458. command, in the form of a verb-noun pair.  This table contains
  459. one record for each verb-noun pair for which the adventure
  460. author wishes to define an action.  Each entry consists of the
  461. verb and noun to which the action is to be linked, and a line 
  462. naming the tests and actions to be performed by the driver if 
  463. the verb-noun command is given.
  464.  
  465. All letters used in nouns and verbs here must be upper case.  
  466. The verb, noun, and all test or action names must be separated
  467. by one or more spaces; and the record terminated by a 
  468. space-period-carriage return sequence.
  469.  
  470. Action entries may be divided over several lines.  If a line 
  471. ends with a space-comma-carriage return, the next line is 
  472. treated as a continuation of the same action line.
  473.  
  474.  
  475.  
  476. REMARKS SECTION
  477.  
  478. The ninth and last section is ignored entirely by the compiler
  479. and provides space for the author to place any remarks he 
  480. wishes to add to the database.
  481.  
  482.  
  483. ACTION ENTRIES
  484.  
  485. Action entries define tests to be performed and activity to 
  486. take place based upon the results of the tests, either as a 
  487. background activity (implicit action) or as a result of a 
  488. player instruction (an explicit action, invoked by a verb-noun
  489. pair).  These are what actually tell the driver program what 
  490. to do in response to situations or player input.  Each action 
  491. entry consists of one line of tests and actions to be carried 
  492. out.  Each test and action available has a four-character 
  493. mnemonic name (called a "token") and represents either a 
  494. specific test to be performed ("is the golden key in the 
  495. King's Chamber?") or action to be taken ("display message 2").
  496.  
  497. Each token has from zero to two data fields associated with 
  498. it which specify the parameters involved in the test or action
  499. (object numbers, locations, etc).  These follow the token name
  500. as decimal numbers.
  501.  
  502. There is no particular limit to the length of a typed action 
  503. entry, but the total number of tokens (and data fields 
  504. associated with them) in a single action entry must not exceed
  505. 255.
  506.  
  507. When the driver executes an action line, that line is 
  508. interpreted from left to right.  Tests and actions may be 
  509. mixed unconditionally within an action line.  If the token 
  510. involves a test, the truth of the tested condition is 
  511. evaluated and logically ANDed with a truth flag; if the token 
  512. is an action it is performed if the truth flag is currently 
  513. TRUE (that is, all the preceding tests returned a logical 
  514. TRUE).
  515.  
  516. Any test may be inverted by prefixing it with a "-" character.
  517. This will cause the opposite condition from that specified to 
  518. be tested.  For example, token "INRX" means "in room X", and 
  519. "INRX 4" returns a logical TRUE if the player is then in room 
  520. 4.  If the token is inverted, as "-INRX 4", it returns a 
  521. logical TRUE if the player is NOT in room 4.
  522.  
  523. Any action may also be inverted in the same way.  An action is
  524. normally performed if all the preceding tests returned logical
  525. TRUE; an inverted action is performed if one or more of the 
  526. preceding tests returned a logical FALSE.
  527.  
  528. Following is a list of the tokens available and their 
  529. functions.  Where used, "x" and "y" represent prototype values
  530. supplied after the token as data.
  531.  
  532.  
  533. Test tokens
  534.  
  535. TOKEN        RETURNS "TRUE" IF
  536. --------------------------------------------------------------
  537. HASX x       The player is carrying object x
  538. NCRX x       Object x is in the current room (the same room as
  539.                the player)
  540. AVLX x       Object x is available to the player (either in
  541.                the same room or carried)
  542. XINY x y     Object x is in room y
  543. NSRX x       Object x is in its start room
  544. NR0X x       Object x is in room zero (out of play)
  545. XW/Y x y     Object x is in the same room as object y
  546. HASL         The player is carrying the object linked to the
  547.                current noun (the "linked object")
  548. NCRL         The linked object is in the same room as the
  549.                player
  550. AVLL         The linked object is available to the player
  551. LINX x       The linked object is in room x
  552. NSRL         The linked object is in its start room
  553. NR0L         The linked object is in room 0
  554. LW/X x       The linked object is in the same room as object x
  555. RAND x       x% chance of returning TRUE
  556. CEQN x y     Counter #x is equal to y
  557. CGEN x y     Counter #x is greater than or equal to y
  558. CEQC x y     Counter #x is equal to counter #y
  559. CGEC x y     Counter #x is greater than or equal to counter #y
  560. XSET x       Bit flag #x is set
  561. INRX x       Player is in room x
  562. LIGH         The current location is lighted
  563. LDGT x       The player's load is greater than x%
  564. OBJ= x       The command's (grammatical) object referred to
  565.                (material) object #x.  The (grammatical) object
  566.                in the command line must have been a noun which
  567.                is linked to a (material) object for this to
  568.                work.  OBJ= 0 will return TRUE if either the
  569.                input specified no object or the (grammatical)
  570.                object is not linked to a (material) object
  571.                in the noun dictionary.
  572.  
  573.  
  574.  
  575. ACTION TOKENS
  576.  
  577. TOKEN        Performance
  578. ------------------------------------------------------------
  579. X2RY x y     Object x is moved to room y
  580. X2OY x y     Object x is moved to object y
  581. X2CR x       Object x is moved to the current room
  582. X2SR x       Object x is moved to its start room
  583. X2R0 x       Object x is moved to room 0
  584. X<>Y x y     Objects x and y are exchanged
  585. L2RX x       Linked object is moved to room x
  586. L2OX x       Linked object is moved to object x
  587. L2CR         Linked object is moved to the current room
  588. L2SR         Linked object is moved to its start room
  589. L2R0         Linked object is moved to room 0
  590. L<>X x       Linked object is exchanged with object x
  591. DROP         All objects carried by player are dropped (moved
  592.                to current room)
  593. P2RX x       The player is moved to room x
  594. P2OX x       The player is moved to the room occupied by
  595.                object x
  596. SCO+ x       x is added to the player's score, x=-127 to 127
  597. HEAL x       x is added to the player's health, x=-100 to 100
  598. CTX+ x y     y is added to counter x, y=-127 to 127
  599. CTX= x y     Counter x is set equal to y, y=-127 to 127
  600. SETX x       Bit flag x is set
  601. CLRX x       Bit flag x is reset (cleared)
  602. MSGX x       Message x is displayed
  603. ENDG         The game is ended
  604. LMP1         Illumination is "on"
  605. LMP0         Illumination is "off" -- darkness
  606. DIAG         Display health state
  607. WAIT x       Game play pauses for about x/4 seconds.
  608. ECHO         The player's input is echoed in format "To <verb>
  609.                a <noun> with a <object> ", with a trailing
  610.                space but without a following carriage return
  611. RPTV         Repeat verb.  The last input verb is displayed
  612.                without leading or trailing blanks.
  613. RPTN         Repeat noun.  The last input noun is
  614.                displayed without leading or trailing blanks.
  615. RPTO         Repeat object.  The last input object is
  616.                displayed without leading or trailing blanks.
  617. ELSE         If TRUE when evaluated, action processing ends;
  618.                if FALSE, the truth state is reset to TRUE and
  619.                processing restarts with the next token
  620. SAVE         The current game situation is saved to a disk
  621.                file.
  622. LOAD         A saved game situation is read from a disk file
  623.                created by SAVE, and becomes the current
  624.                situation.
  625.  
  626. EXAMPLES:
  627.  
  628. (a) if at any time the player carries object 17 into room 4, 
  629. make object 8 appear and display message 7.  This is a 
  630. background-type activity and would go in the background 
  631. activity table.  In specific terms,
  632.  
  633. if player is in room 4, and                   INRX 4
  634.    player is carrying object 17, then         HASX 17
  635.    move object 8 to current room, and         X2CR 8
  636.    display message 7.                         MSGX 7
  637.  
  638. The action entry would be:  INRX 4 HASX 17 X2CR 8 MSGX 7 .<CR>
  639.  
  640.  
  641. (b) if the player specifies "RUB LANTERN", and is carrying 
  642. object 2 (the lantern), and object 4 (a magic preventer) is 
  643. not either carried or in the current room (hence not 
  644. available), then bring a genie into the room and display 
  645. message 10 ("POOF!"); otherwise display message 11 ("The 
  646. lantern gets shinier").
  647.  
  648. If player commands "RUB LANTERN",         RUB LANTERN
  649.  
  650. and has object 2                          HASX 2
  651. and object 4 isn't around                 -AVLX 4
  652. then bring in genie to current room       X2CR 7
  653. and display message 10                    MSGX 10
  654.  
  655. otherwise,                                ELSE
  656. display message 11                        MSGX 11
  657.  
  658. The action entry would be:
  659.  
  660. RUB LANTERN HASX 2 -AVLX 4 X2CR 7 MSGX 10 ELSE MSGX 11 .<CR>
  661.  
  662.  
  663. (c) If the player attacks a demon with any object besides a 
  664. sword, display "To attack a demon with a <whatever> is not a 
  665. good idea."  The sword is object 4, and "is not a good idea./"
  666. is message 9.
  667.  
  668. If player specifies "ATTACK DEMON"         ATTACK DEMON
  669. and the object is not "SWORD"              -OBJ= 4
  670. echo user input                            ECHO
  671. and print message 9                        MSGX 9
  672.  
  673. The action entry would be:
  674.  
  675. ATTACK DEMON -OBJ= 4 ECHO MSGX 9 .
  676.  
  677.  
  678.  
  679. SEPCIFYING DEFAULT ROUTINES FOR EXPLICIT ACTIONS
  680.  
  681. LADS provides default action handlers which allow the 
  682. adventure creator to handle a variety of general situations 
  683. using only one explicit action entry.  A default action has 
  684. the same form as any other action line, but specifies ANY as a
  685. noun.  A verb's default action is invoked if there is no 
  686. action routine defined for the verb-noun pair the player has 
  687. issued or if the noun isn't in the game dictionary.
  688.  
  689. For example, most adventures would provide a general-purpose 
  690. response to the command to examine anything unimportant to the
  691. effect of "You find it perfectly ordinary."  Rather than 
  692. having tediously to define action entries for each possible 
  693. examination, you can specify a single entry as EXAMINE ANY.  
  694. This action would then be performed if the player typed 
  695. "EXAMINE something", and either there was no explicit action 
  696. entry defined for that verb-noun pair or the noun wasn't in 
  697. the dictionary.
  698.  
  699.  
  700. GET, DROP, and GO also have default action handlers, which are
  701. built into the driver.  If the player issues a GET noun, DROP 
  702. noun, or GO noun command the driver will (first) try to find a
  703. specific action entry for the command, then failing that will 
  704. (second) look for a GET ANY, DROP ANY, or GO ANY action 
  705. routine, then (failing even that) try to execute its own 
  706. internal GET, DROP, or GO handler.
  707.  
  708. For GET, the object will be picked up if all of the following
  709. conditions are met:  (a) the noun is linked to an object, (b) 
  710. the linked object is in the same room as the player, (c) it is
  711. not carried, (d) it is not immovable (weight is not 255), and 
  712. (e) the player's load will permit the acquisition.  If any of 
  713. these tests fails, an appropriate message will be displayed 
  714. (such as "You can't carry that much more weight."); if the 
  715. object is picked up the driver will announce "The (whatever) 
  716. taken."
  717.  
  718. For DROP, the object will be dropped if (a) the noun is linked
  719. to an object, and (b) the object is carried.  If either test 
  720. fails, an message will be printed (either "You can't do that" 
  721. if the noun has no linked object, or "You aren't carrying 
  722. it.")  If the tests succeed, the driver will display "The 
  723. (whatever) released."
  724.  
  725. For GO, the player will move if the noun was a legal direction
  726. and there is a link to a room in the specified direction.
  727.  
  728.  
  729.  
  730. TECHNICAL STUFF
  731.  
  732.  
  733. EXACT INTERPRETATION LOGIC
  734.  
  735. The general flow of action processing is:  display situation
  736. --> get user command --> carry out command --> conduct 
  737. background activity --> display new situation ...
  738.  
  739. Actions are interpreted as follows:
  740.  
  741. 1.  Parse command.  The verb, noun, and object are extracted
  742.     from the input line and each is looked up in a vocabulary
  743.     table.  If the verb doesn't exist, an error is declared
  744.     ("I don't know how to <verb>").  If the noun dosn't exist
  745.     or isn't specified, the driver assigns noun "ANY" to the
  746.     command.  The object number is looked up and stored.  If
  747.     no object is specified or the specified object isn't a
  748.     noun linked to an object, the object number is set to
  749.     zero.
  750.  
  751. 2.  If entire command is "I" or "L", control is transferred
  752.     immediately to the appropriate routine.  The index file is
  753.     not accessed in this case.
  754.  
  755. 3.  The index file is checked for the existence of an action
  756.     routine for the specified verb-noun pair.  If an action
  757.     routine exists, it is read from the reference file and
  758.     control is passed to the action executor.
  759.  
  760. 4.  If no action entry for the verb-noun pair exists, the
  761.     driver rechecks the index for an entry for "verb ANY".  If
  762.     one is found, it is read from the reference file disk and
  763.     control is passed to the action executor.
  764.  
  765. 5.  If no action entry for "verb ANY" exists and the verb is
  766.     GET or DROP; or the verb is GO and no action has yet been
  767.     taken (even if a GO ANY routine exists and has been
  768.     attempted), control is passed to an internal routine
  769.     dealing with GET or DROP or GO.  Note that action table
  770.     entries take precedence over these internal default
  771.     routines, and that the existance of GET ANY or DROP and
  772.     action routines will lock out the driver's internal GET
  773.     and DROP routines.
  774.  
  775. 6.  If none of the above succeed, an error is declared and the
  776.     message "I don't know how to verb noun." is displayed.
  777.  
  778.  
  779. SPECIFICATIONS
  780.  
  781. Vocabulary:  99 verbs, 99 nouns
  782. Object table:  255 objects
  783. Room table:    254 playing rooms
  784.                  (room 0 is reserved as a store)
  785.                  (room 255 is the player)
  786. Message table:  255 message texts
  787. Action table:   unlimited auto (background) actions
  788.                 up to 9999 action entries
  789. Counters:       256 available, numbered 0-255, Basic integers
  790.                   counter 0 holds the move count
  791. Bit flags:      256 available, numbered 0-255
  792.  
  793.  
  794.  
  795. RESPONSIBILITIES OF THE ADVENTURE AUTHOR
  796.  
  797. This compiler will let you specify just about any action.  The
  798. only things it disallows are those it just can't fit into the
  799. system's database structure, like two rooms with the same 
  800. number.  It is the responsibility of the adventure author to 
  801. ensure that the actions he specifies are realistic.  The 
  802. compiler/driver system won't stop you from doing something 
  803. idiotic; if you want to put the player in room 0 or such, 
  804. it'll let you.
  805.  
  806.  
  807. TECHNICAL SUPPORT
  808.  
  809. Contact the author:  Pete Levy, 4209 Longmeadow Way, Fort 
  810. Worth, TX 76133; (817) 292-8731 nights.  Please don't call 
  811. collect, I'm just a poor but honest programmer and can't 
  812. afford it.
  813.  
  814.  
  815. *** COPIED 01/13/84 12:35:20 BY UR ***
  816.